<template>
  <!-- 选择题 -->
  <div class="choice-question">
    <div class="question-title">
      <p class="title-left">
        <span class="red-text">*</span>
        <span>{{ title}} <span class="gray-text">[填写]</span></span>
      </p>
      <p 
        :class="{'is-end': isEnd}"
        class="title-right">{{ '未完成' }}</p>
    </div>
    <input type="text" placeholder="请填写" class="input"/>
  </div>
</template>

<script>
export default {
  props: {
    questionIndex: {
      type: Number,
      default: 0
    },
    title: {
      type: String,
      default: ''
    },
    isEnd: {
      type: Boolean,
      default: false
    },
    value: {
      type: String,
      default: ''
    },
  },
  methods: {
    // TODO 当用户输入的时候，实时提交表单
  }
}
</script>

<style scoped>
.input {
  display: block;
  width: 85.33vw;
  height: 10.67vw;
  box-sizing: border-box;
  padding-left: 4.27vw;
  background: #F2F2F2;
  border-radius: 1.07vw;
  font-family: Source Sans Pro;
  font-size: 4.27vw;
  font-weight: normal;
  color: #333333;
  border: 0.27vw solid #F2F2F2;
}
input::-webkit-input-placeholder{
  font-family: Source Han Sans CN;
  font-size: 4.27vw;
  font-weight: normal;
  color: #CCCCCC;
}
.gray-text {
  color: #CCCCCC;
}
.question-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4.27vw;
}
.title-right {
  width: 16.53vw;
  height: 5.87vw;
  line-height: 5.87vw;
  text-align: center;
  border-radius: 2.93vw;
  background: #FF7628;
  font-family: Source Sans Pro;
  font-size: 3.2vw;
  font-weight: 600;
  color: #FFFFFF;
  flex-shrink: 0;
}
.question-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 3.2vw;
  width: 78.93vw;
  height: 9.6vw;
  box-sizing: border-box;
  padding: 0 2.13vw 0 4vw;
  font-family: Source Sans Pro;
  font-size: 3.73vw;
  font-weight: normal;
  background: #FEFFFE;
  border-radius: 1.07vw;
  color: #666;
  border: 0.27vw solid #EFEFEF;
}

.active {
  background: rgba(10, 103, 255, 0.1);
  color: #0A67FF;
  border: 0.27vw solid rgba(63, 140, 244, 0.3)
}
.img {
  width: 4.27vw;
  height: 4.27vw;
  margin-right: 2.13vw;
}
.red-text {
  color: #EE0A24;
  margin-right: 0.8vw;
  font-family: Source Sans Pro;
  font-size: 4.27vw;
}
.choice-question {
  width: 96vw;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 4.27vw 4.27vw 6.4vw;
  background: #fff;
  border-radius: 2.13vw;
  font-family: Source Sans Pro;
  font-size: 4.27vw;
  font-weight: 600;
  color: #3D3D3D;
}
.is-end {
  background: #008924;
}
</style>